package com.Enum;


import lombok.Data;


public enum LoggerEnum {
    INFO(1,"信息日志"),    // 信息日志
    DEBUG(2,"调试日志"),   // 调试日志
    ERROR(3,"错误日志"),   // 错误日志
    WARNING(4,"警告日志"); // 警告日志

    private final int priority;
    private final String logrre;


    LoggerEnum(int priority, String logrre) {
        this.priority = priority;
        this.logrre = logrre;
    }

    public int getPriority() {
        return priority;
    }

    public String getLogrre() {
        return logrre;
    }

    // 判断当前等级是否符合输出要求：比如Debug级别的日志可以输出debug和info的日志
    public boolean shouldLog(LoggerEnum currentLogLevel) {
        return this.priority >= currentLogLevel.getPriority();
    }
}
